import javax.swing.*;
//swing是java设计图形画界面(GUI)的工具包
import java.awt.*;
import java.util.Scanner;
public class panel2 extends JLayeredPane{
    int count =1;
    static String wenzi2;
    panel2(){
        Scanner in = new Scanner(System.in);
        System.out.println("输入想要出现的文字");
        String  wenzi= in.nextLine();
        wenzi2=wenzi;

    }
    public  void paint(Graphics g) {
        Font f2 = new Font("华文琥珀",Font.PLAIN,80);
        g.setColor(new Color(220,20,60));g.setFont(f2);g.drawString(panel2.wenzi2,240,350);
        if(count>0){
            repaint();
        }
    }

}

